#pragma once
#include "loadUtils.h"

/**
 * @brief Struct for storing futbolista data
 */
struct FutbolistaVars{
	int playerID;
	int teamID;
	char name[21];
	int price;
	int value;
};

/**
 * @brief keeps count of how many futbolistas there are, also used for memory reallocation
 */
extern int futbolistacount;

/**
 * @brief Load futbolista file into memory
 *
 * @param filename
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @return return code
 */
int loadFutbolistas(char const *filename,struct FutbolistaVars **data_ptr);

/**
 * @brief save futbolistadata to file
 *
 * @param filename
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @return return code
 */
int writeFutbolistas(char const *filename,struct FutbolistaVars *data);

/**
 * @brief add a futbolista to the vector, reallocates if needed
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @param n
 */
void addFutbolista(struct FutbolistaVars n,struct FutbolistaVars **data_ptr);

/**
 * @brief removes a futbolista by index
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @param index
 */
void rmFutbolista(int index,struct FutbolistaVars **data_ptr);
